/* Constants */
local ACTION_CONTINUOUS		= 1
local ACTION_STOPPABLE		= 2

/* Constructor */
Keyframe = class( function( self, ... )
	
	/* Default values */
	self.Position			= 0
	self.Value				= 0
	self.EaseIn				= 0.5
	self.EaseOut			= 0.5
	self.Action				= ACTION_CONTINUOUS
	
	/* Read parameters */
	local positionParam		= select( 1, ... )
	local valueParam		= select( 2, ... )
	local easeInParam		= select( 3, ... )
	local easeOutParam		= select( 4, ... )
	local stoppableParam	= select( 5, ... )
	
	/* Assign position */
	if IsNumber( positionParam ) then
		self.Position		= math.Clamp( positionParam, 0, 1 )
	end
	
	/* Assign value */
	if valueParam then
		self.Value			= valueParam
	end
	
	/* Assign ease in */
	if IsNumber( easeInParam ) then
		self.EaseIn			= math.Clamp( easeInParam, 0, 1 )
	end
	
	/* Assign ease out */
	if IsNumber( easeOuParam ) then
		self.EaseOut		= math.Clamp( easeOutParam, 0, 1 )
	end
	
	/* Assign stoppable */
	if IsBool( stoppableParam ) then
		if stoppableParam then self.Action = ACTION_STOPPABLE
		else self.Action = ACTION_CONTINUOUS end
	end
end )

/* Set to continuous */
Keyframe.SetContinuous = function( self )
	self.Action				= ACTION_CONTINUOUS
end

/* Set to stoppable */
Keyframe.SetStoppable = function( self )
	self.Action				= ACTION_STOPPABLE
end

/* Check if it is continuous */
Keyframe.IsContinuous = function( self )
	return self.Action == ACTION_CONTINUOUS
end

/* Check if it is stoppable */
Keyframe.IsStoppable = function( self )
	return self.Action == ACTION_STOPPABLE
end